home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
s-gikan2.maizuru-ct.ac.jp
/
s-gikan2.maizuru-ct.ac.jp.zip
/
s-gikan2.maizuru-ct.ac.jp
/
pub
/
old
/
ncvc351d_install.exe
/
{app}
/
scripts
/
LatheViewCompleteSet
/
X_to_0.5X.pl
< prev
Wrap
Perl Script
|
2004-10-08
|
528b
|
29 lines
#! /usr/bin/perl
# Xì└òWé≡1/2ö{é╔ò╧è╖é╖éΘâXâNâèâvâg #
$ratio = 0.5;
$pre_file= $ARGV[0];
$out_file= $ARGV[1];
open(IN,$pre_file);
open(OUT,">$out_file");
while(<IN>){
if(!/^N?[0-9\s]*[\(\%]/){
$new_line= "";
while(/X([\-\d\.]+)/){
($pre_line,$num,$_)= ($`,$1,$');
$num= int(int($num*1000) * $ratio);
$num= $num/1000;
if($num !~ /\./ and $num != 0){ $num = $num."\.";}
$new_line= $new_line.$pre_line."X".$num;
}
$_= $new_line.$_;
}
print OUT;
}
close(OUT);
close(IN);